package linwen.wang.application.impl.v4;

import linwen.wang.joinMemory.annotation.JoinInMemory;
import linwen.wang.vo.*;
import lombok.Data;

@Data
public class OrderDetailVOV4 extends OrderDetailVO {
    private final OrderVO order;
    @JoinInMemory(keyFromSourceData = "#{order.userId}",
            keyFromJoinData = "#{id}",
            loader = "#{@userServiceImpl.listByIds(#root)}",
            joinDataConverter = "#{@userConvertMapperImpl.userConvertUserVO(#root)}"
        )
    private UserVO user;

    @JoinInMemory(keyFromSourceData = "#{order.addressId}",
            keyFromJoinData = "#{id}",
            loader = "#{@addressServiceImpl.listByIds(#root)}",
            joinDataConverter = "#{@addressConvertMapperImpl.addressConvertAddressVO(#root)}"
    )
    private AddressVO address;

    @JoinInMemory(keyFromSourceData = "#{order.productId}",
            keyFromJoinData = "#{id}",
            loader = "#{@productServiceImpl.listByIds(#root)}",
            joinDataConverter = "#{@productConvertMapperImpl.productConvertProductVO(#root)}"
    )
    private ProductVO product;
}